package com.mall.user.domain.model;

public record CompanyName(String name) {
    public CompanyName {
        //公司名称长度必须大于等于0个字符且小于等于20个字符
        if (name.length() < 0 || name.length() > 20) {
            throw new IllegalArgumentException("公司名称长度必须大于等于0个字符且小于等于20个字符");
        }
    }

    public static CompanyName of(String name) {
        return new CompanyName(name);
    }
}
